-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[ADD] estate: Added Estate module #842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 18.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass 🚀.
The PR commits contains a lot of unnecessary diffs left without any reason please avoid that 🙏
Thank you 🙂
estate/__manifest__.py
Outdated
'name': 'Estate', | ||
'installable': True, | ||
'application': True, | ||
'auto_install': False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need auto_install if you have to set it to false?
@@ -0,0 +1,5 @@ | |||
from . import estate_property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copyright info is missing
Refer this https://github.com/odoo/odoo/blob/cc5d7f3e068ca37488b0d716efacf36727401704/addons/account/__init__.py#L2
Apples through the diff
estate/models/estate_property.py
Outdated
|
||
_order = "id desc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to leave extra line to define the _order property
estate/models/estate_property.py
Outdated
total_area = fields.Float(compute="_compute_total") | ||
|
||
@api.depends("garden_area", "living_area") | ||
def _compute_total(self): | ||
for record in self: | ||
record.total_area = record.garden_area + record.living_area | ||
|
||
best_offer = fields.Float(compute="_find_best") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why there is compute method defined in between the field definition?
Any specific reason ?
|
||
status = fields.Selection( | ||
selection=[ | ||
('new', 'New'), | ||
('sold', 'Sold'), | ||
('cancelled', 'Cancelled') | ||
], | ||
default='new', | ||
copy=False | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here as above.
|
||
_sql_constraints = [ | ||
('property_type_unique', 'unique(name)', 'property type should be unique') | ||
] | ||
|
||
offer_count = fields.Integer(string="Offer Count", compute="_compute_offer_count") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Defining SQL constrains in between field definition ?
please avoid this
estate/models/inherited_model.py
Outdated
class InheritedFields(models.Model): | ||
_inherit = 'res.users' | ||
|
||
property_ids = fields.One2many('estate.property', 'salesman_id', domain=[('state', 'not in', ['sold', 'cancelled'])]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The model name is very unusual here.
The name of the model should be pick in such a way it justifies its purpose.
estate/views/estate_menu.xml
Outdated
|
||
</menuitem> | ||
|
||
</odoo> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End of File Line is missing
</list> | ||
</field> | ||
</record> | ||
</odoo> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EOF line missing
<record id = "estate_property_type_form" model = "ir.ui.view"> | ||
<field name = "name">estate.property.type.form</field> | ||
<field name = "model">estate.property.type</field> | ||
<field name = "arch" type="xml"> | ||
<form> | ||
<sheet> | ||
<div class="oe_button_box" name="button_box"> | ||
<button name="%(action_property_offers)d" | ||
type="action" | ||
class="oe_stat_button" | ||
icon="fa-money"> | ||
<field name="offer_count" widget="statinfo" string="Offers"/> | ||
</button> | ||
</div> | ||
<h1 class="mb32"> | ||
<field name="name" class="mb16"/> | ||
</h1> | ||
|
||
<notebook> | ||
<page string="Properties"> | ||
|
||
<field name ="property_ids"> | ||
<list> | ||
<field name ="name"/> | ||
<field name = "expected_price" /> | ||
<field name ="state" /> | ||
</list> | ||
</field> | ||
|
||
</page> | ||
</notebook> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diff contains a bunch of unnecessary line left in between. please resolve this
Built on Odoo, the Estate module provides a comprehensive platform for real estate management. Users can list properties, manage offers, assign salespeople, and automate property status updates. This uses Odoo features like computed fields, constraints, One2many relations, and custom actions.